﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using System.Data.Common;
using System.Diagnostics;

using Microsoft.Practices.Unity;

using ObjectEditor.Configuration;
using EQEmu.Database;

namespace EQEmu.DatabasePlugin
{
    public sealed class EQEmuDatabaseModuleConfiguration : IModuleConfiguration
    {
        private EQEmuContextFactory _factory = null;

        public void Initialize(Microsoft.Practices.Unity.IUnityContainer container)
        {
        }

        public void Finalize(Microsoft.Practices.Unity.IUnityContainer container)
        {
            _factory = new TracingEQEmuContextFactory();
            container.RegisterInstance<EQEmuContextFactory>(_factory);
        }

        public void Dispose()
        {
            if (_factory != null)
            {
                _factory.Dispose();
            }
        }
    }
}
